package com.hdax.dm.rest.service;

import com.hdax.dm.api.base.BaseControllerAPI;
import com.hdax.dm.entity.base.Area;
import com.hdax.dm.entity.base.DmImage;
import com.hdax.dm.service.AreaService;
import com.hdax.dm.service.DmImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RestImageService implements BaseControllerAPI {

    @Autowired
    private DmImageService dmImageService;
    public DmImage image(@PathVariable("targetId") Long targetId){
        return dmImageService.image(targetId);
    }

    @Autowired
    private AreaService areaService;
    @Override
    public List<Area> areas() {
        return areaService.list();
    }
}
